﻿using Common;
using DevExpress.XtraEditors;
using DLL;
using NursingFormSystem.Common;
using NursingFormSystem.Model;
using SQLDLL;
using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using System.Windows.Forms;
using System.Linq;

namespace NursingFormSystem.HandoverSlip
{
    public partial class HandoverSing : Form
    {
        #region 变量声明
        NursingFormRecord record = new NursingFormRecord();
        NurFormsService.NursingForm formService = new NurFormsService.NursingForm();
        PatientInfo PatientInfo;
        Tb_User LoginUser;
        string Id = string.Empty;
        ElectronicSignature es;
        #endregion

        #region 窗体构造函数
        public HandoverSing(Tb_User loginUser, PatientInfo patientInfo)
        {
            InitializeComponent();
            //成员变量赋值
            this.LoginUser = loginUser;
            this.PatientInfo = patientInfo;
            es = new ElectronicSignature(LoginUser);//电签实例化
            //绑定数据
            BindInfo(this.Id);
        }
        public HandoverSing(string[] loginUser, string[] patientInfo)
        {
            InitializeComponent();
            //成员变量赋值
            this.LoginUser = ArrayToObject.ArrayToLoginUser(loginUser);
            this.PatientInfo = ArrayToObject.ArrayToPatientInfo(patientInfo);
            es = new ElectronicSignature(LoginUser);//电签实例化
            //绑定数据
            BindInfo(this.Id);
        }

        /// <summary>
        /// 用于新增的时候 默认设置手术诊断
        /// </summary>
        private void SetDiagnose()
        {
            //获取诊断信息
            string sql = string.Format("SELECT TOP 1 DIAGNOSE FROM V_YDHL_PATIENT(NOLOCK) WHERE PATIENT_ID='{0}' AND VISIT_ID={1}", PatientInfo.PATIENT_ID, PatientInfo.VISIT_ID);
            object diagnose = SqlHelper.ExecuteScalar(CommandType.Text, sql);
            if (diagnose == DBNull.Value || diagnose == null || string.IsNullOrEmpty(diagnose.ToString()))
            {
                txtShuQianZhenDuan.Text = string.Empty;
                return;
            }
            txtShuQianZhenDuan.Text = diagnose.ToString();
        }
        /// <summary>
        /// 用于新增的时候 默认设置拟手术名称
        /// </summary>
        private void SetOperation()
        {
            //获取拟手术名称
            string sql = string.Format("SELECT TOP 1 OPERATION_NAME FROM dbo.V_YDHL_OPERATION_REC(NOLOCK) WHERE PATIENT_ID='{0}' AND VISIT_ID='{1}' AND OPERATION_STATUS<>'撤销'", PatientInfo.PATIENT_ID, PatientInfo.VISIT_ID);
            object operation = SqlHelper.ExecuteScalar(CommandType.Text, sql);
            if (operation == DBNull.Value || operation == null || string.IsNullOrEmpty(operation.ToString()))
            {
                txtNiShouShuMingCheng.Text = string.Empty;
                return;
            }
            txtNiShouShuMingCheng.Text = operation.ToString();
        }

        #endregion

        #region 查询
        private void btn_Query_Click(object sender, EventArgs e)
        {
            BindInfo(this.Id);
        }

        public void BindInfo(string Id)
        {
            this.dateEditriqi.DateTime = DateTime.Now;
            var ret = formService.GetNursingFormRecordOrderByTime(PatientInfo.PATIENT_ID, PatientInfo.VISIT_ID, (int)FormType.PatientHandover, 1);
            if (ret.Code == 1)
            {
                List<NursingFormRecord> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<NursingFormRecord>>(ret.D);
                if (string.IsNullOrEmpty(this.Id))
                    record = list[0];
                else
                    record = list.Find(p => p.Id == Convert.ToInt32(this.Id));
                this.Id = record.Id.ToString();
                var NursingFormData = record.NursingFormData;
                PatientHandover ps = new PatientHandover();
                ps = XmlUtil.XMLToObject<PatientHandover>(NursingFormData, Encoding.UTF8);
                dateEditriqi.DateTime = DateTime.Now;
                if (!string.IsNullOrEmpty(ps.RiQi))
                    dateEditriqi.DateTime = Convert.ToDateTime(ps.RiQi);
                txtShuQianZhenDuan.Text = ps.ShuQianZhenDuan;//术前诊断
                txtNiShouShuMingCheng.Text = ps.NiShouShuMingCheng;//拟手术名称
                if (!string.IsNullOrEmpty(ps.JieRuShiShouShuMingCheng))
                    txtjierushishousumingchen.Text = ps.JieRuShiShouShuMingCheng;//介入室手术名称
                //入手术室
                txtTiWen.Text = ps.RuShouShuShi.TiWen;//体温
                txtMaiBo.Text = ps.RuShouShuShi.MaiBo;//脉搏
                txtHuXi.Text = ps.RuShouShuShi.HuXi;//呼吸
                //血压
                var XueYa = ps.RuShouShuShi.XueYa.Split('/');
                txtXueYa.Text = XueYa[0];
                txtXueYa1.Text = XueYa[1];
                txtSSSW_MingCheng.Text = ps.RuShouShuShi.SSSW_MingCheng;//随身饰物-名称
                txtSSSW_JianShu.Text = ps.RuShouShuShi.SSSW_JianShu;//随身饰物-件数
                txtSQLZ_MingCheng.Text = ps.RuShouShuShi.SQLZ_MingCheng;//术前留置-名称
                txtPFQK_NeiRong.Text = ps.RuShouShuShi.PFQK_NeiRong;//皮肤情况-情况
                txtHuShiQianMing.Text = ps.RuShouShuShi.HuShiQianMing;//护士签名
                txtShouShuShiHuShiQianMing.Text = ps.RuShouShuShi.ShouShuShiHuShiQianMing;//手术室护士签名
                txtYWGMS_QiTa.Text = ps.RuShouShuShi.YWGMS_QiTa;//药物过敏史-内容
                txtXDWP_QiTa.Text = ps.RuShouShuShi.XDWP_QiTa;//携带物品-内容

                radYiShi.SelectedIndex = Convert.ToInt32(ps.RuShouShuShi.YiShi == "" ? "-1" : ps.RuShouShuShi.YiShi);//意识
                radWanDai.SelectedIndex = Convert.ToInt32(ps.RuShouShuShi.WanDai == "" ? "-1" : ps.RuShouShuShi.WanDai);//腕带
                radShouShuBuWeiBiaoShi.SelectedIndex = Convert.ToInt32(ps.RuShouShuShi.ShouShuBuWeiBiaoShi == "" ? "-1" : ps.RuShouShuShi.ShouShuBuWeiBiaoShi);//手术部位标识
                radBeiPi.SelectedIndex = Convert.ToInt32(ps.RuShouShuShi.BeiPi == "" ? "-1" : ps.RuShouShuShi.BeiPi);//备皮
                radGenYi.SelectedIndex = Convert.ToInt32(ps.RuShouShuShi.GenYi == "" ? "-1" : ps.RuShouShuShi.GenYi);//更衣
                radXinZangQiBoQi.SelectedIndex = Convert.ToInt32(ps.RuShouShuShi.XinZangQiBoQi == "" ? "-1" : ps.RuShouShuShi.XinZangQiBoQi);//心脏起搏器
                radZhiRuWu.SelectedIndex = Convert.ToInt32(ps.RuShouShuShi.ZhiRuWu == "" ? "-1" : ps.RuShouShuShi.ZhiRuWu);//植入物
                radYiChi.SelectedIndex = Convert.ToInt32(ps.RuShouShuShi.YiChi == "" ? "-1" : ps.RuShouShuShi.YiChi);//义齿
                radSuiShenShiWu.SelectedIndex = Convert.ToInt32(ps.RuShouShuShi.SuiShenShiWu == "" ? "-1" : ps.RuShouShuShi.SuiShenShiWu);//随身饰物
                radYaoWuGuoMinShi.SelectedIndex = Convert.ToInt32(ps.RuShouShuShi.YaoWuGuoMinShi == "" ? "-1" : ps.RuShouShuShi.YaoWuGuoMinShi);//药物过敏史
                radHuanZheQuXiang.SelectedIndex = Convert.ToInt32(ps.RuShouShuShi.HuanZheQuXiang == "" ? "-1" : ps.RuShouShuShi.HuanZheQuXiang);//患者去向

                //特殊感染
                var TeShuGanRan = ps.RuShouShuShi.TeShuGanRan.Split('#');
                if (TeShuGanRan[0] == "1")
                    CheTeShuGanRan1.Checked = true;
                else
                    CheTeShuGanRan1.Checked = false;
                if (TeShuGanRan[1] == "1")
                    CheTeShuGanRan2.Checked = true;
                else
                    CheTeShuGanRan2.Checked = false;
                if (TeShuGanRan[2] == "1")
                    CheTeShuGanRan3.Checked = true;
                else
                    CheTeShuGanRan3.Checked = false;
                if (TeShuGanRan[3] == "1")
                    CheTeShuGanRan4.Checked = true;
                else
                    CheTeShuGanRan4.Checked = false;
                if (TeShuGanRan[4] == "1")
                    CheTeShuGanRan5.Checked = true;
                else
                    CheTeShuGanRan5.Checked = false;
                //携带物品
                var XieDaiWuPin = ps.RuShouShuShi.XieDaiWuPin.Split('#');
                if (XieDaiWuPin[0] == "1")
                    CheXieDaiWuPin1.Checked = true;
                else
                    CheXieDaiWuPin1.Checked = false;
                if (XieDaiWuPin[1] == "1")
                    CheXieDaiWuPin2.Checked = true;
                else
                    CheXieDaiWuPin2.Checked = false;
                if (XieDaiWuPin[2] == "1")
                    CheXieDaiWuPin3.Checked = true;
                else
                    CheXieDaiWuPin3.Checked = false;
                if (XieDaiWuPin[3] == "1")
                    CheXieDaiWuPin4.Checked = true;
                else
                    CheXieDaiWuPin4.Checked = false;
                if (XieDaiWuPin[4] == "1")
                    CheXieDaiWuPin5.Checked = true;
                else
                    CheXieDaiWuPin5.Checked = false;

                chkRuYaoWuYiZhiXing.Checked = !string.IsNullOrEmpty(ps.RuShouShuShi.XDWP_YaoWu_YiZhiXing) && ps.RuShouShuShi.XDWP_YaoWu_YiZhiXing.Equals("1");
                txtRuYaoWuZhiXingShiJian.Text = ps.RuShouShuShi.XDWP_YaoWu_ZhiXingShiJian;


                //静脉通络
                var JingMaiTongLu = ps.RuShouShuShi.JingMaiTongLu.Split('#');
                if (JingMaiTongLu[0] == "1")
                    CheJingMaiTongLu1.Checked = true;
                else
                    CheJingMaiTongLu1.Checked = false;
                if (JingMaiTongLu[1] == "1")
                    CheJingMaiTongLu2.Checked = true;
                else
                    CheJingMaiTongLu2.Checked = false;
                if (JingMaiTongLu[2] == "1")
                    CheJingMaiTongLu3.Checked = true;
                else
                    CheJingMaiTongLu3.Checked = false;
                if (JingMaiTongLu[3] == "1")
                    CheJingMaiTongLu4.Checked = true;
                else
                    CheJingMaiTongLu4.Checked = false;
                if (JingMaiTongLu[4] == "1")
                    CheJingMaiTongLu5.Checked = true;
                else
                    CheJingMaiTongLu5.Checked = false;
                //术前留置
                var ShuQianLiuZhi = ps.RuShouShuShi.ShuQianLiuZhi.Split('#');
                if (ShuQianLiuZhi[0] == "1")
                    CheShuQianLiuZhi1.Checked = true;
                else
                    CheShuQianLiuZhi1.Checked = false;
                if (ShuQianLiuZhi[1] == "1")
                    CheShuQianLiuZhi2.Checked = true;
                else
                    CheShuQianLiuZhi2.Checked = false;
                if (ShuQianLiuZhi[2] == "1")
                    CheShuQianLiuZhi3.Checked = true;
                else
                    CheShuQianLiuZhi3.Checked = false;
                if (ShuQianLiuZhi[3] == "1")
                    CheShuQianLiuZhi4.Checked = true;
                else
                    CheShuQianLiuZhi4.Checked = false;
                //皮肤情况
                var PiFuQingKuang = ps.RuShouShuShi.PiFuQingKuang.Split('#');
                if (PiFuQingKuang[0] == "1")
                    ChePiFuQingKuang1.Checked = true;
                else
                    ChePiFuQingKuang1.Checked = false;
                if (PiFuQingKuang[1] == "1")
                    ChePiFuQingKuang2.Checked = true;
                else
                    ChePiFuQingKuang2.Checked = false;
                if (PiFuQingKuang[2] == "1")
                    ChePiFuQingKuang3.Checked = true;
                else
                    ChePiFuQingKuang3.Checked = false;

                txtJiebingrensj.Text = ps.RuShouShuShi.JieBingRenShiJian;
                textbingliwenbenkuang.Text = ps.RuShouShuShi.XDWP_BingLi;
                textEdityixiangziliao.Text = ps.RuShouShuShi.XDWP_YingXiangZiLiao;
                textEdityaowu.Text = ps.RuShouShuShi.XDWP_YaoWu;
                textEditxuezhipin.Text = ps.RuShouShuShi.XDWP_XueZhiPin;

                //出手术室
                txtXDWP_QiTa1.Text = ps.ChuShouShuShi.XDWP_QiTa;//携带物品-内容
                txtSSSW_MingCheng1.Text = ps.ChuShouShuShi.SSSW_MingCheng;//随身饰物-名称
                txtSSSW_JianShu1.Text = ps.ChuShouShuShi.SSSW_JianShu;//随身饰物-件数
                txtXZP_MingChengDaiShu.Text = ps.ChuShouShuShi.XZP_MingChengDaiShu;//血制品-名称
                txtSHLZ_QiTa.Text = ps.ChuShouShuShi.SHLZ_QiTa;//术后留置-名称
                txtPFQK_NeiRong1.Text = ps.ChuShouShuShi.PFQK_NeiRong;//皮肤情况-情况
                txtHuShiQianMing1.Text = ps.ChuShouShuShi.HuShiQianMing;//护士签名
                txtShouShuShiHuShiQianMing1.Text = ps.ChuShouShuShi.ShouShuShiHuShiQianMing;//手术室护士签名

                radYiShi1.SelectedIndex = Convert.ToInt32(ps.ChuShouShuShi.YiShi == "" ? "-1" : ps.ChuShouShuShi.YiShi);//意识
                radWanDai1.SelectedIndex = Convert.ToInt32(ps.ChuShouShuShi.WanDai == "" ? "-1" : ps.ChuShouShuShi.WanDai);//腕带
                radSuiShenShiWu1.SelectedIndex = Convert.ToInt32(ps.ChuShouShuShi.SuiShenShiWu == "" ? "-1" : ps.ChuShouShuShi.SuiShenShiWu);//随身饰物
                radXueZhiPin.SelectedIndex = Convert.ToInt32(ps.ChuShouShuShi.XueZhiPin == "" ? "-1" : ps.ChuShouShuShi.XueZhiPin);//血制品
                radHuanZheQuXiang1.SelectedIndex = Convert.ToInt32(ps.ChuShouShuShi.HuanZheQuXiang == "" ? "-1" : ps.ChuShouShuShi.HuanZheQuXiang);//患者去向

                //携带物品
                var XieDaiWuPin1 = ps.ChuShouShuShi.XieDaiWuPin.Split('#');
                if (XieDaiWuPin1[0] == "1")
                    CheXieDaiWuPin11.Checked = true;
                else
                    CheXieDaiWuPin11.Checked = false;
                if (XieDaiWuPin1[1] == "1")
                    CheXieDaiWuPin22.Checked = true;
                else
                    CheXieDaiWuPin22.Checked = false;
                if (XieDaiWuPin1[2] == "1")
                    CheXieDaiWuPin33.Checked = true;
                else
                    CheXieDaiWuPin33.Checked = false;
                if (XieDaiWuPin1[3] == "1")
                    CheXieDaiWuPin44.Checked = true;
                else
                    CheXieDaiWuPin44.Checked = false;
                //静脉通络
                var JingMaiTongLu1 = ps.ChuShouShuShi.JingMaiTongLu.Split('#');
                if (JingMaiTongLu1[0] == "1")
                    CheJingMaiTongLu11.Checked = true;
                else
                    CheJingMaiTongLu11.Checked = false;
                if (JingMaiTongLu1[1] == "1")
                    CheJingMaiTongLu22.Checked = true;
                else
                    CheJingMaiTongLu22.Checked = false;
                if (JingMaiTongLu1[2] == "1")
                    CheJingMaiTongLu33.Checked = true;
                else
                    CheJingMaiTongLu33.Checked = false;
                if (JingMaiTongLu1[3] == "1")
                    CheJingMaiTongLu44.Checked = true;
                else
                    CheJingMaiTongLu44.Checked = false;
                if (JingMaiTongLu1[4] == "1")
                    CheJingMaiTongLu55.Checked = true;
                else
                    CheJingMaiTongLu55.Checked = false;
                //术后留置
                var ShuHouLiuZhi = ps.ChuShouShuShi.ShuHouLiuZhi.Split('#');
                if (ShuHouLiuZhi[0] == "1")
                    CheShuHouLiuZhi1.Checked = true;
                else
                    CheShuHouLiuZhi1.Checked = false;
                if (ShuHouLiuZhi[1] == "1")
                    CheShuHouLiuZhi2.Checked = true;
                else
                    CheShuHouLiuZhi2.Checked = false;
                if (ShuHouLiuZhi[2] == "1")
                    CheShuHouLiuZhi3.Checked = true;
                else
                    CheShuHouLiuZhi3.Checked = false;
                if (ShuHouLiuZhi[3] == "1")
                    CheShuHouLiuZhi4.Checked = true;
                else
                    CheShuHouLiuZhi4.Checked = false;
                if (ShuHouLiuZhi[4] == "1")
                    CheShuHouLiuZhi5.Checked = true;
                else
                    CheShuHouLiuZhi5.Checked = false;
                //携带物品
                var PiFuQingKuang1 = ps.ChuShouShuShi.PiFuQingKuang.Split('#');
                if (PiFuQingKuang1[0] == "1")
                    ChePiFuQingKuang11.Checked = true;
                else
                    ChePiFuQingKuang11.Checked = false;
                if (PiFuQingKuang1[1] == "1")
                    ChePiFuQingKuang22.Checked = true;
                else
                    ChePiFuQingKuang22.Checked = false;
                if (PiFuQingKuang1[2] == "1")
                    ChePiFuQingKuang33.Checked = true;
                else
                    ChePiFuQingKuang33.Checked = false;

                txtchushoushushishijian.Text = ps.ChuShouShuShi.ChuShouShuShiShiJian;

                //出PACU
                txtXDWP_QiTa2.Text = ps.ChuPACU.XDWP_QiTa;//携带物品-内容
                txtSSSW_MingCheng2.Text = ps.ChuPACU.SSSW_MingCheng;//随身饰物-名称
                txtSSSW_JianShu2.Text = ps.ChuPACU.SSSW_JianShu;//随身饰物-件数
                txtXZP_MingChengDaiShu1.Text = ps.ChuPACU.XZP_MingChengDaiShu;//血制品-名称
                txtSHLZ_NeiRong.Text = ps.ChuPACU.SHLZ_NeiRong;//术后留置-名称
                txtPFQK_NeiRong2.Text = ps.ChuPACU.PFQK_NeiRong;//皮肤情况-情况
                txtMaiBo1.Text = ps.ChuPACU.MaiBo;//脉搏
                //血压
                var XueYa1 = ps.ChuPACU.XueYa.Split('/');
                txtXueYa2.Text = XueYa1[0];
                txtXueYa3.Text = XueYa1[1];
                txtXueYangBaoHeDu.Text = ps.ChuPACU.XueYangBaoHeDu;//血氧饱和度
                txtHuShiQianMing2.Text = ps.ChuPACU.HuShiQianMing;//护士签名
                txtPACU_YiShiQianMing.Text = ps.ChuPACU.PACU_YiShiQianMing;//PACU医师签名

                radYiShi2.SelectedIndex = Convert.ToInt32(ps.ChuPACU.YiShi == "" ? "-1" : ps.ChuPACU.YiShi);//意识
                radWanDai2.SelectedIndex = Convert.ToInt32(ps.ChuPACU.WanDai == "" ? "-1" : ps.ChuPACU.WanDai);//腕带
                radSuiShenShiWu2.SelectedIndex = Convert.ToInt32(ps.ChuPACU.SuiShenShiWu == "" ? "-1" : ps.ChuPACU.SuiShenShiWu);//随身饰物
                radXueZhiPin1.SelectedIndex = Convert.ToInt32(ps.ChuPACU.XueZhiPin == "" ? "-1" : ps.ChuPACU.XueZhiPin);//血制品
                radPCA_Beng.SelectedIndex = Convert.ToInt32(ps.ChuPACU.PCA_Beng == "" ? "-1" : ps.ChuPACU.PCA_Beng);//PCA泵
                radPCA_BengTuJing.SelectedIndex = Convert.ToInt32(ps.ChuPACU.PCA_BengTuJing == "" ? "-1" : ps.ChuPACU.PCA_BengTuJing);//PCA泵途径
                radHuanZheQuXiang2.SelectedIndex = Convert.ToInt32(ps.ChuPACU.HuanZheQuXiang == "" ? "-1" : ps.ChuPACU.HuanZheQuXiang);//患者去向

                //携带物品
                var XieDaiWuPin2 = ps.ChuPACU.XieDaiWuPin.Split('#');
                if (XieDaiWuPin2[0] == "1")
                    CheXieDaiWuPin111.Checked = true;
                else
                    CheXieDaiWuPin111.Checked = false;
                if (XieDaiWuPin2[1] == "1")
                    CheXieDaiWuPin222.Checked = true;
                else
                    CheXieDaiWuPin222.Checked = false;
                if (XieDaiWuPin2[2] == "1")
                    CheXieDaiWuPin333.Checked = true;
                else
                    CheXieDaiWuPin333.Checked = false;
                if (XieDaiWuPin2[3] == "1")
                    CheXieDaiWuPin444.Checked = true;
                else
                    CheXieDaiWuPin444.Checked = false;
                //静脉通络
                var JingMaiTongLu2 = ps.ChuPACU.JingMaiTongLu.Split('#');
                if (JingMaiTongLu2[0] == "1")
                    CheJingMaiTongLu111.Checked = true;
                else
                    CheJingMaiTongLu111.Checked = false;
                if (JingMaiTongLu2[1] == "1")
                    CheJingMaiTongLu222.Checked = true;
                else
                    CheJingMaiTongLu222.Checked = false;
                if (JingMaiTongLu2[2] == "1")
                    CheJingMaiTongLu333.Checked = true;
                else
                    CheJingMaiTongLu333.Checked = false;
                if (JingMaiTongLu2[3] == "1")
                    CheJingMaiTongLu444.Checked = true;
                else
                    CheJingMaiTongLu444.Checked = false;
                if (JingMaiTongLu2[4] == "1")
                    CheJingMaiTongLu555.Checked = true;
                else
                    CheJingMaiTongLu555.Checked = false;
                //术后留置
                var ShuHouLiuZhi1 = ps.ChuPACU.ShuHouLiuZhi.Split('#');
                if (ShuHouLiuZhi1[0] == "1")
                    CheShuHouLiuZhi11.Checked = true;
                else
                    CheShuHouLiuZhi11.Checked = false;
                if (ShuHouLiuZhi1[1] == "1")
                    CheShuHouLiuZhi22.Checked = true;
                else
                    CheShuHouLiuZhi22.Checked = false;
                if (ShuHouLiuZhi1[2] == "1")
                    CheShuHouLiuZhi33.Checked = true;
                else
                    CheShuHouLiuZhi33.Checked = false;
                //皮肤情况
                var PiFuQingKuang2 = ps.ChuPACU.PiFuQingKuang.Split('#');
                if (PiFuQingKuang2[0] == "1")
                    ChePiFuQingKuang111.Checked = true;
                else
                    ChePiFuQingKuang111.Checked = false;
                if (PiFuQingKuang2[1] == "1")
                    ChePiFuQingKuang222.Checked = true;
                else
                    ChePiFuQingKuang222.Checked = false;
                if (PiFuQingKuang2[2] == "1")
                    ChePiFuQingKuang333.Checked = true;
                else
                    ChePiFuQingKuang333.Checked = false;

                txtchupacushijian.Text = ps.ChuPACU.ChuPACU_ShiJian;

                //护士签字-电签
                es.SetSiginPic(LoginUser.DepartmentCode, ps.RuShouShuShi.HuShiQianMing_ID, pictureBox1, txtHuShiQianMing.Location, txtHuShiQianMing);
                if (txtHuShiQianMing.Text.Equals(this.LoginUser.UserName)) txtHuShiQianMingId = true;
                //手术室护士签字-电签
                es.SetSiginPic(LoginUser.DepartmentCode, ps.RuShouShuShi.ShouShuShiHuShiQianMing_ID, pictureBox2, txtShouShuShiHuShiQianMing.Location, txtShouShuShiHuShiQianMing);
                if (txtShouShuShiHuShiQianMing.Text.Equals(this.LoginUser.UserName)) txtShouShuShiHuShiQianMingId = true;
                //手术室护士签字-电签
                es.SetSiginPic(LoginUser.DepartmentCode, ps.ChuShouShuShi.ShouShuShiHuShiQianMing_ID, pictureBox3, txtShouShuShiHuShiQianMing1.Location, txtShouShuShiHuShiQianMing1);
                if (txtShouShuShiHuShiQianMing1.Text.Equals(this.LoginUser.UserName)) txtShouShuShiHuShiQianMing1Id = true;
                //护士签字-电签
                es.SetSiginPic(LoginUser.DepartmentCode, ps.ChuShouShuShi.HuShiQianMing_ID, pictureBox4, txtHuShiQianMing1.Location, txtHuShiQianMing1);
                if (txtHuShiQianMing1.Text.Equals(this.LoginUser.UserName)) txtHuShiQianMing1Id = true;
                //PACU医师签字-电签
                es.SetSiginPic(LoginUser.DepartmentCode, ps.ChuPACU.PACU_YiShiQianMing_ID, pictureBox5, txtPACU_YiShiQianMing.Location, txtPACU_YiShiQianMing);
                if (txtPACU_YiShiQianMing.Text.Equals(this.LoginUser.UserName)) txtPACU_YiShiQianMingId = true;
                //护士签字-电签
                es.SetSiginPic(LoginUser.DepartmentCode, ps.ChuPACU.HuShiQianMing_ID, pictureBox6, txtHuShiQianMing2.Location, txtHuShiQianMing2);
                if (txtHuShiQianMing2.Text.Equals(this.LoginUser.UserName)) txtHuShiQianMing2Id = true;
            }
            else if (ret.Code == 2)
            {
                InsertMode(false);
                return;
            }
            else
            {
                MessageBox.Show(ret.M);
            }
        }


        #endregion

        #region 保存
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(dateEditriqi.Text))
                dateEditriqi.DateTime = DateTime.Now;

            PatientHandover ph = new PatientHandover();
            ph.FormId = (int)FormType.PatientHandover;
            ph.FormName = EnumHelper.GetDescription(FormType.PatientHandover);
            ph.RiQi = dateEditriqi.DateTime.ToString("yyyy-MM-dd HH:mm:ss");//日期
            ph.ShuQianZhenDuan = txtShuQianZhenDuan.Text;//术前诊断
            ph.JieRuShiShouShuMingCheng = txtjierushishousumingchen.Text;
            ph.NiShouShuMingCheng = txtNiShouShuMingCheng.Text;//拟手术名称
            //入手术室
            ph.RuShouShuShi.TiWen = txtTiWen.Text;//体温
            ph.RuShouShuShi.MaiBo = txtMaiBo.Text;//脉搏
            ph.RuShouShuShi.HuXi = txtHuXi.Text;//呼吸
            ph.RuShouShuShi.XueYa = txtXueYa.Text + "/" + txtXueYa1.Text;//血压
            ph.RuShouShuShi.SSSW_MingCheng = txtSSSW_MingCheng.Text;//随身饰物-名称
            ph.RuShouShuShi.SSSW_JianShu = txtSSSW_JianShu.Text;//随身饰物-件数
            ph.RuShouShuShi.SQLZ_MingCheng = txtSQLZ_MingCheng.Text;//术前留置-名称
            ph.RuShouShuShi.PFQK_NeiRong = txtPFQK_NeiRong.Text;//皮肤情况-情况

            ph.RuShouShuShi.HuShiQianMing = txtHuShiQianMing.Text;//护士签名
            if (txtHuShiQianMingId && !string.IsNullOrEmpty(txtHuShiQianMing.Text) && txtHuShiQianMing.Text.Equals(this.LoginUser.UserName))
                ph.RuShouShuShi.HuShiQianMing_ID = this.LoginUser.UserId;

            ph.RuShouShuShi.ShouShuShiHuShiQianMing = txtShouShuShiHuShiQianMing.Text;//手术室护士签名
            if (txtShouShuShiHuShiQianMingId && !string.IsNullOrEmpty(txtShouShuShiHuShiQianMing.Text) && txtShouShuShiHuShiQianMing.Text.Equals(this.LoginUser.UserName))
                ph.RuShouShuShi.ShouShuShiHuShiQianMing_ID = this.LoginUser.UserId;

            ph.RuShouShuShi.YWGMS_QiTa = txtYWGMS_QiTa.Text;//药物过敏史-内容
            ph.RuShouShuShi.XDWP_QiTa = txtXDWP_QiTa.Text;//携带物品-内容

            ph.RuShouShuShi.YiShi = radYiShi.EditValue + "";//意识
            ph.RuShouShuShi.WanDai = radWanDai.EditValue + "";//腕带
            ph.RuShouShuShi.ShouShuBuWeiBiaoShi = radShouShuBuWeiBiaoShi.EditValue + "";//手术部位标识
            ph.RuShouShuShi.BeiPi = radBeiPi.EditValue + "";//备皮
            ph.RuShouShuShi.GenYi = radGenYi.EditValue + "";//更衣
            ph.RuShouShuShi.XinZangQiBoQi = radXinZangQiBoQi.EditValue + "";//心脏起搏器
            ph.RuShouShuShi.ZhiRuWu = radZhiRuWu.EditValue + "";//植入物
            ph.RuShouShuShi.YiChi = radYiChi.EditValue + "";//义齿
            ph.RuShouShuShi.SuiShenShiWu = radSuiShenShiWu.EditValue + "";//随身饰物
            ph.RuShouShuShi.YaoWuGuoMinShi = radYaoWuGuoMinShi.EditValue + "";//药物过敏史
            ph.RuShouShuShi.HuanZheQuXiang = radHuanZheQuXiang.EditValue + "";//患者去向

            ph.RuShouShuShi.TeShuGanRan = (CheTeShuGanRan1.Checked ? 1 : 0) + "#" + (CheTeShuGanRan2.Checked ? 1 : 0) + "#" + (CheTeShuGanRan3.Checked ? 1 : 0) + "#" + (CheTeShuGanRan4.Checked ? 1 : 0) + "#" + (CheTeShuGanRan5.Checked ? 1 : 0);//特殊感染
            ph.RuShouShuShi.XieDaiWuPin = (CheXieDaiWuPin1.Checked ? 1 : 0) + "#" + (CheXieDaiWuPin2.Checked ? 1 : 0) + "#" + (CheXieDaiWuPin3.Checked ? 1 : 0) + "#" + (CheXieDaiWuPin4.Checked ? 1 : 0) + "#" + (CheXieDaiWuPin5.Checked ? 1 : 0);//携带物品
            ph.RuShouShuShi.XDWP_YaoWu_YiZhiXing = chkRuYaoWuYiZhiXing.Checked ? "1" : "0";
            ph.RuShouShuShi.XDWP_YaoWu_ZhiXingShiJian = txtRuYaoWuZhiXingShiJian.Text;
            ph.RuShouShuShi.JingMaiTongLu = (CheJingMaiTongLu1.Checked ? 1 : 0) + "#" + (CheJingMaiTongLu2.Checked ? 1 : 0) + "#" + (CheJingMaiTongLu3.Checked ? 1 : 0) + "#" + (CheJingMaiTongLu4.Checked ? 1 : 0) + "#" + (CheJingMaiTongLu5.Checked ? 1 : 0);//静脉通络
            ph.RuShouShuShi.ShuQianLiuZhi = (CheShuQianLiuZhi1.Checked ? 1 : 0) + "#" + (CheShuQianLiuZhi2.Checked ? 1 : 0) + "#" + (CheShuQianLiuZhi3.Checked ? 1 : 0) + "#" + (CheShuQianLiuZhi4.Checked ? 1 : 0);//术前留置
            ph.RuShouShuShi.PiFuQingKuang = (ChePiFuQingKuang1.Checked ? 1 : 0) + "#" + (ChePiFuQingKuang2.Checked ? 1 : 0) + "#" + (ChePiFuQingKuang3.Checked ? 1 : 0);//皮肤情况

            ph.RuShouShuShi.JieBingRenShiJian = txtJiebingrensj.Text;
            ph.RuShouShuShi.XDWP_BingLi = textbingliwenbenkuang.Text;
            ph.RuShouShuShi.XDWP_YingXiangZiLiao = textEdityixiangziliao.Text;
            ph.RuShouShuShi.XDWP_YaoWu = textEdityaowu.Text;
            ph.RuShouShuShi.XDWP_XueZhiPin = textEditxuezhipin.Text;

            //出手术室
            ph.ChuShouShuShi.XDWP_QiTa = txtXDWP_QiTa1.Text;//携带物品-内容
            ph.ChuShouShuShi.SSSW_MingCheng = txtSSSW_MingCheng1.Text;//随身饰物-名称
            ph.ChuShouShuShi.SSSW_JianShu = txtSSSW_JianShu1.Text;//随身饰物-件数
            ph.ChuShouShuShi.XZP_MingChengDaiShu = txtXZP_MingChengDaiShu.Text;//血制品-名称
            ph.ChuShouShuShi.SHLZ_QiTa = txtSHLZ_QiTa.Text;//术后留置-名称
            ph.ChuShouShuShi.PFQK_NeiRong = txtPFQK_NeiRong1.Text;//皮肤情况-情况

            ph.ChuShouShuShi.HuShiQianMing = txtHuShiQianMing1.Text;//护士签名
            if (txtHuShiQianMing1Id && !string.IsNullOrEmpty(txtHuShiQianMing1.Text) && txtHuShiQianMing1.Text.Equals(this.LoginUser.UserName))
                ph.ChuShouShuShi.HuShiQianMing_ID = this.LoginUser.UserId;

            ph.ChuShouShuShi.ShouShuShiHuShiQianMing = txtShouShuShiHuShiQianMing1.Text;//手术室护士签名
            if (txtShouShuShiHuShiQianMing1Id && !string.IsNullOrEmpty(txtShouShuShiHuShiQianMing1.Text) && txtShouShuShiHuShiQianMing1.Text.Equals(this.LoginUser.UserName))
                ph.ChuShouShuShi.ShouShuShiHuShiQianMing_ID = this.LoginUser.UserId;

            ph.ChuShouShuShi.YiShi = radYiShi1.EditValue + "";//意识
            ph.ChuShouShuShi.WanDai = radWanDai1.EditValue + "";//腕带
            ph.ChuShouShuShi.SuiShenShiWu = radSuiShenShiWu1.EditValue + "";//随身饰物
            ph.ChuShouShuShi.XueZhiPin = radXueZhiPin.EditValue + "";//血制品
            ph.ChuShouShuShi.HuanZheQuXiang = radHuanZheQuXiang1.EditValue + "";//患者去向

            ph.ChuShouShuShi.XieDaiWuPin = (CheXieDaiWuPin11.Checked ? 1 : 0) + "#" + (CheXieDaiWuPin22.Checked ? 1 : 0) + "#" + (CheXieDaiWuPin33.Checked ? 1 : 0) + "#" + (CheXieDaiWuPin44.Checked ? 1 : 0);//携带物品
            ph.ChuShouShuShi.JingMaiTongLu = (CheJingMaiTongLu11.Checked ? 1 : 0) + "#" + (CheJingMaiTongLu22.Checked ? 1 : 0) + "#" + (CheJingMaiTongLu33.Checked ? 1 : 0) + "#" + (CheJingMaiTongLu44.Checked ? 1 : 0) + "#" + (CheJingMaiTongLu55.Checked ? 1 : 0);//静脉通络
            ph.ChuShouShuShi.ShuHouLiuZhi = (CheShuHouLiuZhi1.Checked ? 1 : 0) + "#" + (CheShuHouLiuZhi2.Checked ? 1 : 0) + "#" + (CheShuHouLiuZhi3.Checked ? 1 : 0) + "#" + (CheShuHouLiuZhi4.Checked ? 1 : 0) + "#" + (CheShuHouLiuZhi5.Checked ? 1 : 0);//术后留置
            ph.ChuShouShuShi.PiFuQingKuang = (ChePiFuQingKuang11.Checked ? 1 : 0) + "#" + (ChePiFuQingKuang22.Checked ? 1 : 0) + "#" + (ChePiFuQingKuang33.Checked ? 1 : 0);//皮肤情况

            ph.ChuShouShuShi.ChuShouShuShiShiJian = txtchushoushushishijian.Text;

            //出PACU
            ph.ChuPACU.XDWP_QiTa = txtXDWP_QiTa2.Text;//携带物品-内容
            ph.ChuPACU.SSSW_MingCheng = txtSSSW_MingCheng2.Text;//随身饰物-名称
            ph.ChuPACU.SSSW_JianShu = txtSSSW_JianShu2.Text;//随身饰物-件数
            ph.ChuPACU.XZP_MingChengDaiShu = txtXZP_MingChengDaiShu1.Text;//血制品-名称
            ph.ChuPACU.SHLZ_NeiRong = txtSHLZ_NeiRong.Text;//术后留置-名称
            ph.ChuPACU.PFQK_NeiRong = txtPFQK_NeiRong2.Text;//皮肤情况-情况
            ph.ChuPACU.MaiBo = txtMaiBo1.Text;//脉搏
            ph.ChuPACU.XueYa = txtXueYa2.Text + "/" + txtXueYa3.Text;//血压
            ph.ChuPACU.XueYangBaoHeDu = txtXueYangBaoHeDu.Text;//血氧饱和度

            ph.ChuPACU.HuShiQianMing = txtHuShiQianMing2.Text;//护士签名
            if (txtHuShiQianMing2Id && !string.IsNullOrEmpty(txtHuShiQianMing2.Text) && txtHuShiQianMing2.Text.Equals(this.LoginUser.UserName))
                ph.ChuPACU.HuShiQianMing_ID = this.LoginUser.UserId;

            ph.ChuPACU.PACU_YiShiQianMing = txtPACU_YiShiQianMing.Text;//PACU医师签名
            if (txtPACU_YiShiQianMingId && !string.IsNullOrEmpty(txtPACU_YiShiQianMing.Text) && txtPACU_YiShiQianMing.Text.Equals(this.LoginUser.UserName))
                ph.ChuPACU.PACU_YiShiQianMing_ID = this.LoginUser.UserId;

            ph.ChuPACU.YiShi = radYiShi2.EditValue + "";//意识
            ph.ChuPACU.WanDai = radWanDai2.EditValue + "";//腕带
            ph.ChuPACU.SuiShenShiWu = radSuiShenShiWu2.EditValue + "";//随身饰物
            ph.ChuPACU.XueZhiPin = radXueZhiPin1.EditValue + "";//血制品
            ph.ChuPACU.PCA_Beng = radPCA_Beng.EditValue + "";//PCA泵
            ph.ChuPACU.PCA_BengTuJing = radPCA_BengTuJing.EditValue + "";//PCA泵途径
            ph.ChuPACU.HuanZheQuXiang = radHuanZheQuXiang2.EditValue + "";//患者去向

            ph.ChuPACU.XieDaiWuPin = (CheXieDaiWuPin111.Checked ? 1 : 0) + "#" + (CheXieDaiWuPin222.Checked ? 1 : 0) + "#" + (CheXieDaiWuPin333.Checked ? 1 : 0) + "#" + (CheXieDaiWuPin444.Checked ? 1 : 0);//携带物品
            ph.ChuPACU.JingMaiTongLu = (CheJingMaiTongLu111.Checked ? 1 : 0) + "#" + (CheJingMaiTongLu222.Checked ? 1 : 0) + "#" + (CheJingMaiTongLu333.Checked ? 1 : 0) + "#" + (CheJingMaiTongLu444.Checked ? 1 : 0) + "#" + (CheJingMaiTongLu555.Checked ? 1 : 0);//静脉通络
            ph.ChuPACU.ShuHouLiuZhi = (CheShuHouLiuZhi11.Checked ? 1 : 0) + "#" + (CheShuHouLiuZhi22.Checked ? 1 : 0) + "#" + (CheShuHouLiuZhi33.Checked ? 1 : 0);//术后留置
            ph.ChuPACU.PiFuQingKuang = (ChePiFuQingKuang111.Checked ? 1 : 0) + "#" + (ChePiFuQingKuang222.Checked ? 1 : 0) + "#" + (ChePiFuQingKuang333.Checked ? 1 : 0);//皮肤情况

            ph.ChuPACU.ChuPACU_ShiJian = txtchupacushijian.Text;

            string xml = XmlUtil.ObjectToXML(ph, Encoding.UTF8);
            record.NursingFormData = xml;
            record.FormId = ph.FormId;//表单ID
            record.FormName = ph.FormName;//表单Name
            record.PatientId = PatientInfo.PATIENT_ID;//住院号
            record.VisitId = PatientInfo.VISIT_ID;//住院次数
            record.PatientName = PatientInfo.PATIENT_NAME;//患者名称
            record.BedNo = PatientInfo.BED_NO;//床号
            record.DepartmentId = PatientInfo.DEPARTMENT_ID;//科室id
            record.DepartmentName = PatientInfo.DEPARTMENT_NAME;//科室名称
            record.AreaId = PatientInfo.NURSE_CELL_CODE;//病区编号
            record.AreaName = PatientInfo.NURSE_CELL_NAME;//病区名称
            record.AssessmentDate = dateEditriqi.DateTime;

            record.Id = string.IsNullOrEmpty(Id) ? 0 : Convert.ToInt32(Id);
            var ret2 = formService.SetNursingFormRecord(Newtonsoft.Json.JsonConvert.SerializeObject(record));

            if (ret2.S)
            {
                //MessageBox.Show(ret.M);
                //保存字段拼接成xml格式
                string signXml = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?><riqi name=\"日期\">" + dateEditriqi.Text + "</riqi><shuqianzhenduan name=\"术前诊断\">" + txtShuQianZhenDuan.Text + "</shuqianzhenduan>"
                                 + "<nishoushumingcheng name=\"拟手术名称\">" + txtNiShouShuMingCheng.Text + "</nishoushumingcheng><tiwen name=\"体温\">" + txtTiWen.Text + "</tiwen><maobo name=\"脉搏\">" + txtMaiBo.Text + "</maobo>"
                                 + "<huxi name=\"呼吸\">" + txtHuXi.Text + "</huxi><xueya name=\"血压\">" + txtXueYa.Text + "</xueya><xueya1 name=\"血压1\">" + txtXueYa1.Text + "</xueya1>"
                                 + "<wandai name=\"腕带\">" + radWanDai.Text + "</wandai><shoiushubuweibiaoshi name=\"手术部位标识\">" + radShouShuBuWeiBiaoShi.Text + "</shoiushubuweibiaoshi><beipi name=\"备皮\">" + radBeiPi.Text + "</beipi>"
                                 + "<gengyi name=\"更衣\">" + radGenYi.Text + "</gengyi><xinzangqiboqi name=\"心脏起搏器\">" + radXinZangQiBoQi.Text + "</xinzangqiboqi><zhiruwu name=\"植入物\">" + radZhiRuWu.Text + "</zhiruwu>"
                                 + "<yaowuguominshi name=\"药物过敏史\">" + radYaoWuGuoMinShi.Text + "</yaowuguominshi><yaowuguominshiwenbenkuang name=\"药物过敏史文本框\">" + txtYWGMS_QiTa.Text + "</yaowuguominshiwenbenkuang>"
                                 + "<suishenshiwu name=\"随身饰物\">" + radSuiShenShiWu.Text + "</suishenshiwu><suishenshiwumingcheng name=\"随身饰物名称\">" + txtSSSW_MingCheng.Text + "</suishenshiwumingcheng><suishenshiwujianshu name=\"随身饰物件数\">" + txtSSSW_JianShu.Text + "</suishenshiwujianshu>"
                                 + "<pifuqingkuang name=\"皮肤情况\">" + (ChePiFuQingKuang1.Checked ? 1 : 0) + "#" + (ChePiFuQingKuang2.Checked ? 1 : 0) + (ChePiFuQingKuang3.Checked ? 1 : 0) + "</pifuqingkuang><qingkuang name=\"情况\">" + txtPFQK_NeiRong.Text + "</qingkuang>"
                                 + "<shuqianliuzhi name=\"术前留置\">" + (CheShuQianLiuZhi1.Checked ? 1 : 0) + "#" + (CheShuQianLiuZhi2.Checked ? 1 : 0) + (CheShuQianLiuZhi3.Checked ? 1 : 0) + "#" + (CheShuQianLiuZhi4.Checked ? 1 : 0) + "</shuqianliuzhi><mingcheng name=\"名称\">" + txtSQLZ_MingCheng.Text + "</mingcheng>"
                                 + "<teshuganran name=\"特殊感染\">" + (CheTeShuGanRan1.Checked ? 1 : 0) + "#" + (CheTeShuGanRan2.Checked ? 1 : 0) + (CheTeShuGanRan3.Checked ? 1 : 0) + "#" + (CheTeShuGanRan4.Checked ? 1 : 0) + "#" + (CheTeShuGanRan5.Checked ? 1 : 0) + "</teshuganran><yishi name=\"意识\">" + radYiShi.Text + "</yishi>"
                                 + "<jingmaitongluo name=\"静脉通络\">" + (CheJingMaiTongLu1.Checked ? 1 : 0) + "#" + (CheJingMaiTongLu2.Checked ? 1 : 0) + (CheJingMaiTongLu3.Checked ? 1 : 0) + "#" + (CheJingMaiTongLu4.Checked ? 1 : 0) + "#" + (CheJingMaiTongLu5.Checked ? 1 : 0) + "</jingmaitongluo><yichi name=\"义齿\">" + radYiChi.Text + "</yichi>"
                                 + "<xiedaiwupin name=\"携带物品\">" + (CheXieDaiWuPin1.Checked ? 1 : 0) + "#" + (CheXieDaiWuPin2.Checked ? 1 : 0) + (CheXieDaiWuPin3.Checked ? 1 : 0) + "#" + (CheXieDaiWuPin4.Checked ? 1 : 0) + "#" + (CheXieDaiWuPin5.Checked ? 1 : 0) + "</xiedaiwupin><xiedaiwupinwenbenkuang name=\"携带物品文本框\">" + txtXDWP_QiTa.Text + "</xiedaiwupinwenbenkuang>"
                                 + "<jiebingrenshijian name=\"接病人时间\">" + txtJiebingrensj.Text + "</jiebingrenshijian><hushiqianming name=\"护士签名\">" + txtHuShiQianMing.Text + "</hushiqianming><shoushushihushiqianming name=\"手术室护士签名\">" + txtShouShuShiHuShiQianMing.Text + "</shoushushihushiqianming>"
                                 + "<suishenshiwu1 name=\"随身饰物1\">" + radSuiShenShiWu1.Text + "</suishenshiwu1><mingcheng1 name=\"名称1\">" + txtSSSW_MingCheng1.Text + "</mingcheng1><jianshu1 name=\"件数1\">" + txtSSSW_JianShu1.Text + "</jianshu1>"
                                 + "<xuezhipin name=\"血制品\">" + radXueZhiPin.Text + "</xuezhipin><mingchengjidaishu name=\"名称及袋数\">" + txtXZP_MingChengDaiShu.Text + "</mingchengjidaishu>"
                                 + "<yishi1 name=\"意识1\">" + radYiShi1.Text + "</yishi1><wandai1 name=\"腕带1\">" + radWanDai1.Text + "</wandai1>"
                                 + "<pifuqingkuang1 name=\"皮肤情况1\">" + (ChePiFuQingKuang11.Checked ? 1 : 0) + "#" + (ChePiFuQingKuang22.Checked ? 1 : 0) + "#" + (ChePiFuQingKuang33.Checked ? 1 : 0) + "</pifuqingkuang1><qingkuang1 name=\"情况1\">" + txtPFQK_NeiRong1.Text + "</qingkuang1>"
                                 + "<xiedaiwupin2 name=\"携带物品2\">" + (CheXieDaiWuPin11.Checked ? 1 : 0) + "#" + (CheXieDaiWuPin22.Checked ? 1 : 0) + (CheXieDaiWuPin33.Checked ? 1 : 0) + "#" + (CheXieDaiWuPin44.Checked ? 1 : 0) + "</xiedaiwupin2><xiedaiwupinwenbenkuang2 name=\"携带物品文本框2\">" + txtXDWP_QiTa1.Text + "</xiedaiwupinwenbenkuang2>"
                                 + "<shuhouliuzhi name=\"术后留置\">" + (CheShuHouLiuZhi1.Checked ? 1 : 0) + "#" + (CheShuHouLiuZhi2.Checked ? 1 : 0) + (CheShuHouLiuZhi3.Checked ? 1 : 0) + "#" + (CheShuHouLiuZhi4.Checked ? 1 : 0) + "#" + (CheShuHouLiuZhi5.Checked ? 1 : 0) + "</shuhouliuzhi><shuhouliuzhiwenbenkuang name=\"术后留置文本框\">" + txtSHLZ_QiTa.Text + "</shuhouliuzhiwenbenkuang>"
                                 + "<jingmaitongluo2 name=\"静脉通络2\">" + (CheJingMaiTongLu11.Checked ? 1 : 0) + "#" + (CheJingMaiTongLu22.Checked ? 1 : 0) + (CheJingMaiTongLu33.Checked ? 1 : 0) + "#" + (CheJingMaiTongLu44.Checked ? 1 : 0) + "#" + (CheJingMaiTongLu55.Checked ? 1 : 0) + "</jingmaitongluo2><huanzhequxiang name=\"患者去向\">" + radHuanZheQuXiang1.Text + "</huanzhequxiang>"
                                 + "<shoushushihushiqianming name=\"手术室护士签名\">" + txtShouShuShiHuShiQianMing1.Text + "</shoushushihushiqianming><hushiqianming name=\"护士签名1\">" + txtHuShiQianMing1.Text + "</hushiqianming>"
                                 + "<maobo1 name=\"脉搏1\">" + txtMaiBo1.Text + "</maobo1><xueya2 name=\"血压2\">" + txtXueYa2.Text + "</xueya2><xueya3 name=\"血压3\">" + txtXueYa3.Text + "</xueya3>"
                                 + "<xueyangbaohedu name=\"血氧饱和度\">" + txtXueYangBaoHeDu.Text + "</xueyangbaohedu><suishenshiwu2 name=\"随身饰物2\">" + radSuiShenShiWu2.Text + "</suishenshiwu2><mingcheng name=\"名称\">" + txtSSSW_MingCheng2.Text + "</mingcheng><jianshu name=\"件数\">" + txtSSSW_JianShu2.Text + "</jianshu>"
                                 + "<xueshizpin1 name=\"血制品1\">" + radXueZhiPin1.Text + "</xueshizpin1><mingchengjidaishu name=\"名称及袋数\">" + txtXZP_MingChengDaiShu1.Text + "</mingchengjidaishu>"
                                 + "<yishi2 name=\"意识2\">" + radYiShi2.Text + "</yishi2><wandai2 name=\"腕带2\">" + radWanDai2.Text + "</wandai2>"
                                 + "<pingfuqingkuang name=\"皮肤情况\">" + (ChePiFuQingKuang111.Checked ? 1 : 0) + "#" + (ChePiFuQingKuang222.Checked ? 1 : 0) + "#" + (ChePiFuQingKuang333.Checked ? 1 : 0) + "</pingfuqingkuang><qingkuang2 name=\"情况2\">" + txtPFQK_NeiRong2.Text + "</qingkuang2>"
                                 + "<shuhouiliuzhi name=\"术后留置\">" + (CheShuHouLiuZhi11.Checked ? 1 : 0) + "#" + (CheShuHouLiuZhi22.Checked ? 1 : 0) + "#" + (CheShuHouLiuZhi33.Checked ? 1 : 0) + "</shuhouiliuzhi><shuhouliuzhiwenbenkuang name=\"术后留置文本框\">" + txtSHLZ_NeiRong.Text + "</shuhouliuzhiwenbenkuang>"
                                 + "<xiedaiwupin3 name=\"携带物品3\">" + (CheXieDaiWuPin111.Checked ? 1 : 0) + "#" + (CheXieDaiWuPin222.Checked ? 1 : 0) + "#" + (CheXieDaiWuPin333.Checked ? 1 : 0) + "#" + (CheXieDaiWuPin444.Checked ? 1 : 0) + "</xiedaiwupin3><xiedaiwupinwenbenkuang3 name=\"携带物品文本框3\">" + txtXDWP_QiTa2.Text + "</xiedaiwupinwenbenkuang3>"
                                 + "<jingmaitongluo3 name=\"静脉通络3\">" + (CheJingMaiTongLu111.Checked ? 1 : 0) + "#" + (CheJingMaiTongLu222.Checked ? 1 : 0) + (CheJingMaiTongLu333.Checked ? 1 : 0) + "#" + (CheJingMaiTongLu444.Checked ? 1 : 0) + "#" + (CheJingMaiTongLu555.Checked ? 1 : 0) + "</jingmaitongluo3><pacbeng name=\"PCA泵\">" + radPCA_Beng.Text + "</pacbeng>"
                                 + "<huanzhequxiang2 name=\"患者去向2\">" + radHuanZheQuXiang2.Text + "</huanzhequxiang2><tujing name=\"途径\">" + radPCA_BengTuJing.Text + "</tujing><pacuhushiqianming name=\"PACU医师护士签名\">" + txtPACU_YiShiQianMing.Text + "</pacuhushiqianming><hushiqianming2 name=\"护士签名\">" + txtHuShiQianMing2.Text + "</hushiqianming2>";

                if (Base.ESSwitch.Equals("on"))//电签开始
                {
                    string extraInfo = "<?xml version=\"1.0\" encoding=\"UTF-16\"?><root><sign_sys>{0}</sign_sys><title>{1}</title><patient_id>{2}</patient_id><patient_name>{3}</patient_name><emr_id>{4}</emr_id><emr_catalog>{5}</emr_catalog><his_id>{6}</his_id><event_no>{7}</event_no><visit_number>{8}</visit_number><dept_name>{9}</dept_name><prescribe_number>{10}</prescribe_number><prescribe_sub_number>{11}</prescribe_sub_number><prescribe_operation>医嘱操作（发送、校对、停止、作废）或门诊处方操作（发送）</prescribe_operation><radiotherapy_id>放疗号</radiotherapy_id><process_name>CT定位申请单审核</process_name><process_time>CT定位申请单审核时间</process_time><extend_value_1>备用扩展1</extend_value_1><extend_value_2>备用扩展2</extend_value_2><extend_value_3>备用扩展3</extend_value_3><extend_value_4>备用扩展4</extend_value_4><extend_value_5>备用扩展5</extend_value_5><extend_value_6>备用扩展6</extend_value_6><extend_value_7>备用扩展7</extend_value_7><extend_value_8>备用扩展8</extend_value_8><extend_value_9>备用扩展9</extend_value_9></root>";
                    extraInfo = string.Format(extraInfo, EnumHelper.GetDescription(FormType.PatientHandover) + (record.Id > 0 ? "-更新" : "-新增"), EnumHelper.GetDescription(FormType.PatientHandover), record.PatientId, record.PatientName, record.Id, record.FormId, "", record.PatientId, record.VisitId, LoginUser.DepartmentName, record.PatientId, record.PatientId);
                    ElectronicSignature es = new ElectronicSignature(LoginUser);
                    bool res = es.GetElectronicSignatureImage(es, signXml, extraInfo, record.FormId.ToString(), record.FormName, PatientInfo.PATIENT_ID, PatientInfo.VISIT_ID);
                    if (!res) { MessageBox.Show("电子签名失败"); return; }
                }//电签结束 
                MessageBox.Show(record.Id == 0 ? "新增成功" : "更新成功");
                if (record.Id > 0) return;
                //新增成功后绑定数据
                this.Id = string.Empty;
                BindInfo(this.Id);
            }
            else
            {
                MessageBox.Show(ret2.M);
            }
            this.DialogResult = DialogResult.OK;
        }
        #endregion

        #region   入手术室：携带物品，复选框，勾选时显示文本框，不勾选时，隐藏文本框
        private void CheShuQianLiuZhi4_CheckedChanged(object sender, EventArgs e)
        {
            txtSQLZ_MingCheng.Visible = false;
            if (CheShuQianLiuZhi4.Checked)   //手术前留置
            {
                txtSQLZ_MingCheng.Visible = true;
            }
            else { txtSQLZ_MingCheng.Text = string.Empty; }
        }

        private void CheShuHouLiuZhi5_CheckedChanged(object sender, EventArgs e)
        {
            txtSHLZ_QiTa.Visible = false;
            if (CheShuHouLiuZhi5.Checked)     //术后留置
            {
                txtSHLZ_QiTa.Visible = true;
            }
            else { txtSHLZ_QiTa.Text = string.Empty; }
        }

        private void CheXieDaiWuPin44_CheckedChanged(object sender, EventArgs e)
        {
            txtXDWP_QiTa1.Visible = false;
            if (CheXieDaiWuPin44.Checked)    //出手术室：携带物品-其他
            {
                txtXDWP_QiTa1.Visible = true;
            }
            else { txtXDWP_QiTa1.Text = string.Empty; }
        }

        private void CheXieDaiWuPin444_CheckedChanged(object sender, EventArgs e)
        {
            txtXDWP_QiTa2.Visible = false;
            if (CheXieDaiWuPin444.Checked)    //出PACU-携带物品其他
            {
                txtXDWP_QiTa2.Visible = true;
            }
            else { txtXDWP_QiTa2.Text = string.Empty; }
        }

        private void CheXieDaiWuPin1_CheckedChanged(object sender, EventArgs e)
        {
            textbingliwenbenkuang.Visible = false;
            if (CheXieDaiWuPin1.Checked)    //病历
            {
                textbingliwenbenkuang.Visible = true;
            }
            else { textbingliwenbenkuang.Text = string.Empty; }
        }

        private void CheXieDaiWuPin2_CheckedChanged(object sender, EventArgs e)
        {
            textEdityixiangziliao.Visible = false;
            if (CheXieDaiWuPin2.Checked)    //影像资料
            {
                textEdityixiangziliao.Visible = true;
            }
            else { textEdityixiangziliao.Text = string.Empty; }
        }

        private void CheXieDaiWuPin3_CheckedChanged(object sender, EventArgs e)
        {
            textEdityaowu.Visible = false;
            if (CheXieDaiWuPin3.Checked)    //药物
            {
                textEdityaowu.Visible = true;
            }
            else { textEdityaowu.Text = string.Empty; }
        }

        private void CheXieDaiWuPin4_CheckedChanged(object sender, EventArgs e)
        {
            textEditxuezhipin.Visible = false;
            if (CheXieDaiWuPin4.Checked)    //血制品
            {
                textEditxuezhipin.Visible = true;
            }
            else { textEditxuezhipin.Text = string.Empty; }
        }


        private void CheXieDaiWuPin5_CheckedChanged(object sender, EventArgs e)
        {
            txtXDWP_QiTa.Visible = false;
            if (CheXieDaiWuPin5.Checked)    //-其他
            {
                txtXDWP_QiTa.Visible = true;
            }
            else { txtXDWP_QiTa.Text = string.Empty; }
        }
        #endregion

        /// <summary>
        /// 设置 enter键当做Tab切换
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void TemperatureEdit1_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyData == Keys.Enter)
            {
                SendKeys.SendWait("{Tab}");
            }
        }
        /// <summary>
        /// 刷新事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnSearch_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(this.Id)) { MessageBox.Show("当前为新增模式，无法操作"); return; }
            BindInfo(this.Id);
        }
        /// <summary>
        /// 打印事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnPrint_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(this.Id)) { MessageBox.Show("当前为新增模式，无法操作"); return; }
            HandoverPrints f = new HandoverPrints(LoginUser, PatientInfo, Id);
            f.Show();
        }
        /// <summary>
        /// 删除事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnDel_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(this.Id)) { MessageBox.Show("当前为新增模式，无法操作"); return; }
            if (MessageBox.Show("确定要删除数据吗？", "删除前确认", MessageBoxButtons.OKCancel) != DialogResult.OK) return;

            var ret = formService.DeleteNursingFormRecord(this.Id);
            MessageBox.Show(ret.M);
            if (ret.Code != 1) return;
            this.Id = string.Empty;
            BindInfo(this.Id);

        }
        /// <summary>
        /// 没有记录单的时候
        /// </summary>
        private void ShowClose()
        {
            MessageBox.Show(string.Format("该患者没有《{0}》 \r\n 自动转入新增界面", EnumHelper.GetDescription(FormType.PatientHandover)),
                            "关闭提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            InsertMode(false);
        }

        /// <summary>
        /// 历史记录
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnHis_Click(object sender, EventArgs e)
        {
            HistoryHDS f = new HistoryHDS(this.PatientInfo);
            f.ShowDialog();
            if (f.DialogResult != DialogResult.OK) return;
            if (string.IsNullOrEmpty(f.Id)) return;
            this.Id = f.Id;
            BindInfo(this.Id);
        }

        /// <summary>
        /// 新增按钮事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnNew_Click(object sender, EventArgs e)
        {
            InsertMode(true);
        }

        /// <summary>
        /// 进入新增模式
        /// </summary>
        private void InsertMode(bool openTips)
        {
            if (openTips && MessageBox.Show("是否新增该表单", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK)
                return;

            foreach (Control c in pnlHisPatiens.Controls)
                ControlValueClear(c);
            foreach (Control c in groupControl1.Controls)
                ControlValueClear(c);
            foreach (Control c in groupControl2.Controls)
                ControlValueClear(c);
            foreach (Control c in groupControl3.Controls)
                ControlValueClear(c);
            foreach (Control c in panel1.Controls)
                ControlValueClear(c);
            foreach (Control c in panel2.Controls)
                ControlValueClear(c);
            foreach (Control c in panel3.Controls)
                ControlValueClear(c);
            foreach (Control c in panel4.Controls)
                ControlValueClear(c);
            foreach (Control c in panel5.Controls)
                ControlValueClear(c);
            foreach (Control c in panel6.Controls)
                ControlValueClear(c);

            pictureBox1.Visible = false;
            pictureBox2.Visible = false;
            pictureBox3.Visible = false;
            pictureBox4.Visible = false;
            pictureBox5.Visible = false;
            pictureBox6.Visible = false;
            txtHuShiQianMing.Visible = true;
            txtShouShuShiHuShiQianMing.Visible = true;
            txtShouShuShiHuShiQianMing1.Visible = true;
            txtHuShiQianMing1.Visible = true;
            txtPACU_YiShiQianMing.Visible = true;
            txtHuShiQianMing2.Visible = true;
            txtHuShiQianMingId = false;
            txtShouShuShiHuShiQianMingId = false;
            txtShouShuShiHuShiQianMing1Id = false;
            txtHuShiQianMing1Id = false;
            txtPACU_YiShiQianMingId = false;
            txtHuShiQianMing2Id = false;

            this.Id = string.Empty;
            record = new NursingFormRecord();
            dateEditriqi.DateTime = DateTime.Now;
            SetDiagnose();
            SetOperation();
        }
        /// <summary>
        /// 清除控件值
        /// </summary>
        /// <param name="c"></param>
        private static void ControlValueClear(Control c)
        {
            if (c is DateEdit)
                ((DateEdit)c).Text = string.Empty;
            if (c is TextEdit)
                ((TextEdit)c).Text = string.Empty;
            if (c is CheckEdit)
                ((CheckEdit)c).Checked = false;
            if (c is RadioGroup)
                ((RadioGroup)c).SelectedIndex = -1;
        }

        #region 双击获取 接病人时间、出手术室时间、出PACU时间  的当前时间
        private void txtJiebingrensj_DoubleClick(object sender, EventArgs e)
        {
            txtJiebingrensj.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm");     //接病人时间
        }
        private void txtchushoushushishijian_DoubleClick(object sender, EventArgs e)
        {
            txtchushoushushishijian.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm");    //出手术室时间
        }

        private void txtchupacushijian_DoubleClick(object sender, EventArgs e)
        {
            txtchupacushijian.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm");     //出PACU时间
        }
        #endregion

        #region 文本框双击获取签名
        //入手术室--护士签名
        bool txtHuShiQianMingId = false;
        private void txtHuShiQianMing_DoubleClick(object sender, EventArgs e)
        {
            this.txtHuShiQianMing.Text = this.LoginUser.UserName;
            txtHuShiQianMingId = true;
            es.SearchElectronicSignatureImage(Base.ESSwitch, LoginUser, txtHuShiQianMing, pictureBox1, txtHuShiQianMing.Location);
        }

        bool txtShouShuShiHuShiQianMingId = false;
        //入手术室--手术室护士签名
        private void txtShouShuShiHuShiQianMing_DoubleClick(object sender, EventArgs e)
        {
            this.txtShouShuShiHuShiQianMing.Text = this.LoginUser.UserName;
            txtShouShuShiHuShiQianMingId = true;
            es.SearchElectronicSignatureImage(Base.ESSwitch, LoginUser, txtShouShuShiHuShiQianMing, pictureBox2, txtShouShuShiHuShiQianMing.Location);
        }

        bool txtShouShuShiHuShiQianMing1Id = false;
        //出手术室--手术室护士签名
        private void txtShouShuShiHuShiQianMing1_DoubleClick(object sender, EventArgs e)
        {
            this.txtShouShuShiHuShiQianMing1.Text = this.LoginUser.UserName;
            txtShouShuShiHuShiQianMing1Id = true;
            es.SearchElectronicSignatureImage(Base.ESSwitch, LoginUser, txtShouShuShiHuShiQianMing1, pictureBox3, txtShouShuShiHuShiQianMing1.Location);
        }

        bool txtHuShiQianMing1Id = false;
        //出手术室--护士签名
        private void txtHuShiQianMing1_DoubleClick(object sender, EventArgs e)
        {
            this.txtHuShiQianMing1.Text = this.LoginUser.UserName;
            txtHuShiQianMing1Id = true;
            es.SearchElectronicSignatureImage(Base.ESSwitch, LoginUser, txtHuShiQianMing1, pictureBox4, txtHuShiQianMing1.Location);
        }

        bool txtPACU_YiShiQianMingId = false;
        //出PACU--医师签名
        private void txtPACU_YiShiQianMing_DoubleClick(object sender, EventArgs e)
        {
            this.txtPACU_YiShiQianMing.Text = this.LoginUser.UserName;
            txtPACU_YiShiQianMingId = true;
            es.SearchElectronicSignatureImage(Base.ESSwitch, LoginUser, txtPACU_YiShiQianMing, pictureBox5, txtPACU_YiShiQianMing.Location);
        }

        bool txtHuShiQianMing2Id = false;
        //出PACU--护士签名
        private void txtHuShiQianMing2_DoubleClick(object sender, EventArgs e)
        {
            this.txtHuShiQianMing2.Text = this.LoginUser.UserName;
            txtHuShiQianMing2Id = true;
            es.SearchElectronicSignatureImage(Base.ESSwitch, LoginUser, txtHuShiQianMing2, pictureBox6, txtHuShiQianMing2.Location);
        }
        #endregion

        //入手术室--护士签名
        private void rushoushushi_hushiqianming_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(txtHuShiQianMing.Text)) return;
            this.txtHuShiQianMing.Text = this.LoginUser.UserName;
            txtHuShiQianMingId = true;
            es.SearchElectronicSignatureImage(Base.ESSwitch, LoginUser, txtHuShiQianMing, pictureBox1, txtHuShiQianMing.Location);
        }

        //入手术室--手术室护士签名
        private void rushoushushi_shoushushihushiqianming_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(txtShouShuShiHuShiQianMing.Text)) return;
            this.txtShouShuShiHuShiQianMing.Text = this.LoginUser.UserName;
            txtShouShuShiHuShiQianMingId = true;
            es.SearchElectronicSignatureImage(Base.ESSwitch, LoginUser, txtShouShuShiHuShiQianMing, pictureBox2, txtShouShuShiHuShiQianMing.Location);
        }

        //出手术室--手术室护士签名
        private void chushoushushi_shoushushihushiqianming_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(txtShouShuShiHuShiQianMing1.Text)) return;
            this.txtShouShuShiHuShiQianMing1.Text = this.LoginUser.UserName;
            txtShouShuShiHuShiQianMing1Id = true;
            es.SearchElectronicSignatureImage(Base.ESSwitch, LoginUser, txtShouShuShiHuShiQianMing1, pictureBox3, txtShouShuShiHuShiQianMing1.Location);
        }

        //出手术室--护士签名
        private void chushoushushi_hushiqianming_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(txtHuShiQianMing1.Text)) return;
            this.txtHuShiQianMing1.Text = this.LoginUser.UserName;
            txtHuShiQianMing1Id = true;
            es.SearchElectronicSignatureImage(Base.ESSwitch, LoginUser, txtHuShiQianMing1, pictureBox4, txtHuShiQianMing1.Location);
        }

        //出PACU--医师签名
        private void chuPACU_yishiqianming_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(txtPACU_YiShiQianMing.Text)) return;
            this.txtPACU_YiShiQianMing.Text = this.LoginUser.UserName;
            txtPACU_YiShiQianMingId = true;
            es.SearchElectronicSignatureImage(Base.ESSwitch, LoginUser, txtPACU_YiShiQianMing, pictureBox5, txtPACU_YiShiQianMing.Location);
        }

        //出PACU--护士签名
        private void chuPACU_hushiqianming_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(txtHuShiQianMing2.Text)) return;
            this.txtHuShiQianMing2.Text = this.LoginUser.UserName;
            txtHuShiQianMing2Id = true;
            es.SearchElectronicSignatureImage(Base.ESSwitch, LoginUser, txtHuShiQianMing2, pictureBox6, txtHuShiQianMing2.Location);
        }

        private void radYaoWuGuoMinShi_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (radYaoWuGuoMinShi.SelectedIndex == 0 || radYaoWuGuoMinShi.SelectedIndex == -1)
            {
                txtYWGMS_QiTa.Visible = false;
                txtYWGMS_QiTa.Text = "";
            }
            else
            {
                txtYWGMS_QiTa.Visible = true;
            }
        }

        private void radSuiShenShiWu1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (radSuiShenShiWu1.SelectedIndex == 0 || radSuiShenShiWu1.SelectedIndex == -1)
            {
                panel2.Visible = false;
                txtSSSW_MingCheng1.Text = "";
                txtSSSW_JianShu1.Text = "";
            }
            else
            {
                panel2.Visible = true;
            }
        }

        private void radXueZhiPin_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (radXueZhiPin.SelectedIndex == 0 || radXueZhiPin.SelectedIndex == -1)
            {
                txtXZP_MingChengDaiShu.Visible = false;
                labelControl45.Visible = false;
                txtXZP_MingChengDaiShu.Text = "";
            }
            else
            {
                txtXZP_MingChengDaiShu.Visible = true;
                labelControl45.Visible = true;
            }
        }

        private void radSuiShenShiWu2_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (radSuiShenShiWu2.SelectedIndex == 0 || radSuiShenShiWu2.SelectedIndex == -1)
            {
                panel5.Visible = false;
                txtSSSW_MingCheng2.Text = "";
                txtSSSW_JianShu2.Text = "";
            }
            else
            {
                panel5.Visible = true;
            }
        }

        private void radXueZhiPin1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (radXueZhiPin1.SelectedIndex == 0 || radXueZhiPin1.SelectedIndex == -1)
            {
                txtXZP_MingChengDaiShu1.Visible = false;
                labelControl70.Visible = false;
                txtXZP_MingChengDaiShu1.Text = "";
            }
            else
            {
                txtXZP_MingChengDaiShu1.Visible = true;
                labelControl70.Visible = true;
            }
        }

        private void chkRuYaoWuYiZhiXing_MouseUp(object sender, MouseEventArgs e)
        {
            if (chkRuYaoWuYiZhiXing.Checked)
                txtRuYaoWuZhiXingShiJian.DateTime = DateTime.Now;
            else
                txtRuYaoWuZhiXingShiJian.EditValue = null;
        }
    }
}
